package com.yykj.pay.server.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author zengg
 * @since 2022-04-08
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Builder
@Table(
        uniqueConstraints = {
                @UniqueConstraint(columnNames = {"clientId"})
        }
)
@ApiModel(value = "ClientPayConfig对象", description = "")
public class ClientPayConfig {

    @Id
    @Column(length = 32)
    @TableId(type = IdType.INPUT)
    private String payConfigId;

    @NotEmpty(message = "clientType")
    @ApiModelProperty(value = "应用名称 小程序，APP",required = true)
    private String clientType;

    @ApiModelProperty("公司名称")
    private String clientName;

    @NotEmpty(message = "clientId")
    @ApiModelProperty(value = "公司系统标识",required = true)
    private String clientId;

    @NotEmpty(message = "clientAppId")
    @ApiModelProperty(value = "appid",required = true)
    private String clientAppId;

    @NotEmpty(message = "clientSecret")
    @ApiModelProperty(value = "secret",required = true)
    private String clientSecret;

    @NotEmpty(message = "clientMchId")
    @ApiModelProperty(value = "mchId",required = true)
    private String clientMchId;

    @NotEmpty(message = "clientMechKey")
    @ApiModelProperty(value = "mechKey",required = true)
    private String clientMechKey;

    @ApiModelProperty(value = "pem")
    private String clientMechPem;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdTime;

    private String createdBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;


    private String updateBy;

    @NotNull(message = "status")
    @ApiModelProperty(value = "0 : 禁用 1：启用",example = "0")
    private Integer status;

    @ApiModelProperty(value = "删除状态 是否删除 0 : 否 1：是",hidden = true)
    private Integer isDeleted;



}
